package com.blue.firecat.enums;

/**
 * 描述 
 * 时间 2017/6/22 22:05
 * 作者 廖林山
 */
public enum UserStatusEnum {
    UNKNOWN(0, "未知"),
    ACTIVATED(1, "已启用"),
    TERMINATED(2, "已停用");


    private int code;
    private String value;

    UserStatusEnum(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public static String getValueByCode(int code) {
        for (UserStatusEnum status : UserStatusEnum.values()) {
            if (code == status.getCode()) {
                return status.getValue();
            }
        }
        return UNKNOWN.value;
    }


    public int getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }


}
